﻿<PageFunction 
    x:Class="Milkify.Views.TaskNoteEditControl"
    x:TypeArguments="ic:TaskNote"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ic="clr-namespace:IronCow;assembly=IronCow"
    xmlns:m="clr-namespace:Milkify"
    xmlns:md="clr-namespace:Milkify.Data"
    Title="Note"
    KeepAlive="True"
    KeyboardNavigation.IsTabStop="False"
    FocusManager.FocusedElement="{Binding ElementName=TextTitle}">
    <DockPanel>
        <Grid
            DockPanel.Dock="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button
                Name="ButtonOK"
                Grid.Column="0"
                Content="Done"
                Click="ButtonOK_Click"
                KeyboardNavigation.TabIndex="1" />
            <Button
                Name="ButtonCancel"
                Grid.Column="1"
                Content="Cancel"
                IsCancel="True"
                Click="ButtonCancel_Click"
                KeyboardNavigation.TabIndex="2" />
        </Grid>
        <Grid
            VerticalAlignment="Stretch"
            KeyboardNavigation.TabIndex="0"
            Style="{DynamicResource TaskNotePanelStyle}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBox
                Grid.Row="0"
                Name="TextTitle"
                Text="{Binding TaskNote.Title, UpdateSourceTrigger=Explicit}"
                GotKeyboardFocus="TextBox_GotKeyboardFocus" />
            <TextBox
                Grid.Row="1"
                Name="TextBody"
                AcceptsReturn="True"
                TextWrapping="Wrap"
                VerticalAlignment="Stretch"
                Text="{Binding TaskNote.Body, UpdateSourceTrigger=Explicit}" />
        </Grid>
    </DockPanel>
</PageFunction>
